#ifndef __LIGHT_H__
#define __LIGHT_H__

#pragma once

#include "SceneNode.h"

namespace Nezha
{

	//
	enum LightType
	{
		LT_DIRECTIONAL,
		LT_POINT,
		LT_SPOT,

		LT_NUM
	};

	// FIXME don't inhert from scene node.
	class GRAPHICS_ENTRY Light : public SceneNode
	{
	public:
		Light(LightType lt, const _string& name);
		virtual ~Light();

		// override
		SceneObjectType getSOType() const
		{
			return SOT_LIGHT;
		}

		LightType getLitType() const
		{
			return mLitType;
		}

		void setAngle(float angle);

		// FIXME range

NEZHA_INTERNAL:
		RGBA mColor;

		/** attenuation for point light. I / (c + L*d + Q*d^2) */
		float mConstant;
		float mLinear;
		float mQuadratic;

		float mIntensity;

		// spot light param
		float mAngle;
		float mExponent;
		float mSine;
		float mCosine;

	private:
		LightType mLitType;
	};

}//end namespace Nezha

#endif //end __LIGHT_H__